package com.wangshouyu.mp.pay.order;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 关闭订单结果
 * @date 2020/8/13 14:27
 */
@XStreamAlias(value = "xml")
public class CloseOrderResponse implements Serializable {

    /**
     * 返回码
     */
    @XStreamAlias(value = "return_code")
    private String returnCode;

    /**
     * 返回消息
     */
    @XStreamAlias(value = "return_msg")
    private String returnMsg;

    /**
     * 业务结果
     * SUCCESS/FAIL
     */
    @XStreamAlias(value = "result_code")
    private String resultCode;

    /**
     * 对业务结果的补充说明
     */
    @XStreamAlias(value = "result_msg")
    private String resultMsg;

    /**
     * 错误代码
     * 当result_code为FAIL时返回错误代码
     */
    @XStreamAlias(value = "err_code")
    private String errCode;

    /**
     * 错误代码描述
     */
    @XStreamAlias(value = "err_code_des")
    private String errCodeDes;

    /**
     * 公众账号ID
     * 微信支付分配的公众账号ID（企业号corpid即为此appId）
     */
    @XStreamAlias(value = "appid")
    private String appId;

    /**
     * 商户号
     * 微信支付分配的商户号
     */
    @XStreamAlias(value = "mch_id")
    private String mchId;

    /**
     * 随机字符串
     * 随机字符串，不长于32位。
     */
    @XStreamAlias(value = "nonce_str")
    private String nonceStr;

    /**
     * 签名
     */
    @XStreamAlias(value = "sign")
    private String sign;


    public String getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnMsg() {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }

    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public String getErrCodeDes() {
        return errCodeDes;
    }

    public void setErrCodeDes(String errCodeDes) {
        this.errCodeDes = errCodeDes;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CloseOrderResponse that = (CloseOrderResponse) o;
        return Objects.equals(returnCode, that.returnCode) &&
                Objects.equals(returnMsg, that.returnMsg) &&
                Objects.equals(resultCode, that.resultCode) &&
                Objects.equals(resultMsg, that.resultMsg) &&
                Objects.equals(errCode, that.errCode) &&
                Objects.equals(errCodeDes, that.errCodeDes) &&
                Objects.equals(appId, that.appId) &&
                Objects.equals(mchId, that.mchId) &&
                Objects.equals(nonceStr, that.nonceStr) &&
                Objects.equals(sign, that.sign);
    }

    @Override
    public int hashCode() {
        return Objects.hash(returnCode, returnMsg, resultCode, resultMsg, errCode, errCodeDes, appId, mchId, nonceStr, sign);
    }

    @Override
    public String toString() {
        return "CloseOrderResponse{" +
                "returnCode='" + returnCode + '\'' +
                ", returnMsg='" + returnMsg + '\'' +
                ", resultCode='" + resultCode + '\'' +
                ", resultMsg='" + resultMsg + '\'' +
                ", errCode='" + errCode + '\'' +
                ", errCodeDes='" + errCodeDes + '\'' +
                ", appId='" + appId + '\'' +
                ", mchId='" + mchId + '\'' +
                ", nonceStr='" + nonceStr + '\'' +
                ", sign='" + sign + '\'' +
                '}';
    }
}
